<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Seeder;

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     * @return void
     */
    public function run()
    {
        // 创建一个用户
        $user = User::create([
                                 'name'     => 'admin',
                                 'email'    => 'admin@admin.com',
                                 'password' => bcrypt('123456'),
                             ]);
        // 分配角色
        $user->assignRole('super-admin');
    }
}
